package DataReading;

public class Alarm {

	private Vessel vesselX;
	private Vessel vesselY;
	private double distance;
	private char alarmType;


	public Alarm(Vessel a, Vessel b, double d) {
		vesselX = a;
		vesselY = b;
		distance = d;
		if (distance <= 50) {
			alarmType = 'h';
		}
		else if (distance > 50 && distance <= 200) {
			alarmType = 'l';
		}
	}
	
	public Vessel getVesselX() {	return vesselX;	}
	public Vessel getVesselY() {	return vesselY; }
	public double getDistance() { return distance;	}
	public char getAlarmType() { return alarmType;	}
	
	public void setVesselX(Vessel x) { this.vesselX = x; }
	public void setVesselY(Vessel y) { 	this.vesselY = y; 	}
	public void setDistance(double distance) {	this.distance = distance; }
	public void setAlarmType(char alarmType) {	this.alarmType = alarmType;	}

	public String getAlarmName() {
		if (alarmType == 'h') return "High";
		else if (alarmType == 'l') return "Low";
		
		return "Error";
	}
}
